<?php get_header(); ?>

<div id="content">

<?php //Start non-duplicates code
function post_strip($where) {
	global $donotdupe, $wpdb;
	$where .= " AND $wpdb->posts.ID not in($donotdupe) "; 
	return $where;
} 
global $donotdupe;
$donotdupe = '';
?>

<div id="feature" class="clearfix">
<h2>Featured Story</h2>
<?php $my_query = "cat=" . $wp_theme_options['feature_cat'] . "&showposts=1"; $my_query = new WP_Query($my_query); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); $donotdupe .= $post->ID; ?>
	<?php image_attachment('mct_sl_image', '210', '140'); ?>
    <h3 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <div class="meta">By <?php the_author_posts_link(); ?> &bull; on <?php the_time('F j, Y') ?>
    <?php do_action('prox_meta_home',$post->ID); ?></div>
    <p><?php prox_content_limit(350,''); ?></p>
    
<?php endwhile; //do not delete ?>
</div><!--end #feature-->

<?php if($wp_theme_options['adsense_468x60']) : ?>
<!--Begin Adsense Unit-->
<div class="adsense">
<?php echo stripslashes($wp_theme_options['adsense_468x60']); ?>
</div><!--end .adsense-->
<!--End Adsense unit-->
<?php endif; ?>

<div id="categories" class="clearfix">
<?php add_filter('posts_where', 'post_strip'); // to eliminate dupes ?>
<?php foreach((array)$wp_theme_options['post_by_cat'] as $post_by_cat) { ?>
<h2><?php prox_cat_link($post_by_cat); //category title as a link to category archive ?></h2>
<?php $my_query = "cat=".$post_by_cat."&showposts=".$wp_theme_options['post_per_cat']; $my_query = new WP_Query($my_query); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); $donotdupe .= "," . $post->ID; ?>
<div class="post clearfix">
    <?php image_attachment('mct_sl_image', '100', '100'); ?>
    <h3 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
    <div class="meta">By <?php the_author_posts_link(); ?> &bull; on <?php the_time('F j, Y') ?>
    <?php do_action('prox_meta_home',$post->ID); ?></div>
    <p><?php prox_content_limit(150,''); ?></p>
    
</div><!--end .post-->
<?php endwhile; } ?>
<?php remove_filter('posts_where', 'post_strip'); ?>
    
</div><!--end #categories-->

<?php add_filter('posts_where', 'post_strip'); // to eliminate dupes ?>
<div id="headlines">
    <h2><?php echo stripslashes($wp_theme_options['other_title']); ?></h2>
    <?php $my_query = "showposts=".$wp_theme_options['other_posts']; $my_query = new WP_Query($my_query); ?>
	<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <div class="post">
    <h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    <p><?php prox_content_limit(200,''); ?></p>
    
    </div>
    <?php endwhile; //do not delete ?>
</div><!--end #headlines-->
<?php remove_filter('posts_where', 'post_strip'); ?>

</div><!--end #content-->

<!--include sidebar-->
<?php get_sidebar(); ?>

<!--include footer-->
<?php get_footer(); ?>